The phrase "to replace the engine" means to remove the old engine from a machine or vehicle and put in a new one in its place.